<?php
require_once('./db/pdo.php');
require_once('./users/users.php');
include_once('./modules/head.php');

$user = getUserById($_GET['id'], $dbh);

foreach ($user as $elem) 
{
    ?>
        <div class="container">
            <table class="table">
                <thead>
                    <tr>
                        <td>Name</td>
                        <td>Image</td>
                        <td>Username</td>
                        <td>Phone</td>
                        <td>Email</td>
                        <td>Website</td>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td><?= $elem['name'] ?></td>
                        <td><img src="<?= $elem['image'] ?>" alt="" style="width: 150px; height: 150px;"></td>
                        <td><?= $elem['username'] ?></td>
                        <td><?= $elem['phone'] ?></td>
                        <td><?= $elem['email'] ?></td>
                        <td><?= $elem['website'] ?></td>
                    </tr>
                </tbody>
            </table>
            <a href="./index.php" class="btn btn-danger">Back to users list</a>
        </div>
    <?php
}